package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerMagicTradeLogItem implements IQLResponse
{
    /// <summary>
    /// 玩家Id
    /// </summary>
    public long UserId;

    /// <summary>
    /// 玩家昵称
    /// </summary>
    public String Nickname;

    /// <summary>
    /// 1兑换成魔力 2兑换成物品
    /// </summary>
    public long TradeType;

    /// <summary>
    /// 兑换前的魔力值
    /// </summary>
    public long MagicValue1;

    /// <summary>
    /// 兑换后的魔力值
    /// </summary>
    public long MagicValue2;

    /// <summary>
    /// 物品Id
    /// </summary>
    public long ItemId;

    /// <summary>
    /// 物品子Id
    /// </summary>
    public long ItemSubId;

    /// <summary>
    /// 物品兑换数量
    /// </summary>
    public long ItemCount;

    /// <summary>
    /// 物品名称
    /// </summary>
    public String ItemName;

    /// <summary>
    /// 兑换系数
    /// </summary>
    public long Factor;

    /// <summary>
    /// 兑换时间
    /// </summary>
    public String CreateTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("user_id"))
            UserId = t.getLong("user_id");
        if (t.has("nickname"))
            Nickname = t.getString("nickname");
        if (t.has("trade_type"))
            TradeType = t.getLong("trade_type");
        if (t.has("magic_value1"))
            MagicValue1 = t.getLong("magic_value1");
        if (t.has("magic_value2"))
            MagicValue2 = t.getLong("magic_value2");
        if (t.has("item_id"))
            ItemId = t.getLong("item_id");
        if (t.has("item_sub_id"))
            ItemSubId = t.getLong("item_sub_id");
        if (t.has("item_count"))
            ItemCount = t.getLong("item_count");
        if (t.has("item_name"))
            ItemName = t.getString("item_name");
        if (t.has("factor"))
            Factor = t.getLong("factor");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
    }
}
